package com.tang.excel.oci.mapper;

import com.tang.excel.oci.domain.MaterialConsumption;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author Tang
 * @classname MaterialConsumptionMapper
 * @description [  ]
 * @date 2021/3/24 17:25
 */
public interface MaterialConsumptionMapper {
    @Insert(value = {
            "<script>",
            "insert into material_consumption values ",
            "<foreach item = 'item' collection = 'materialConsumptionList' separator = ','>",
            "(#{item.id},#{item.saveDate} , #{item.kclConsumption},",
            "#{item.naohConsumption}, #{item.thermoelectricConsumption},",
            "#{item.powerConsumption}, #{item.dc1}, #{item.dc2},",
            "#{item.dc3}, #{item.genElec},",
            "#{item.createTime}, #{item.updateTime} ,#{item.operatorUser} ,#{item.userId} )",
            "</foreach>",
            "</script>"
    })
    void batchInsert(@Param("materialConsumptionList") List<MaterialConsumption> materialConsumptionList);
}